<template>
    <div class="card">
        <div class="card-body">
            <div class="mb-3">
                <label for="edit-area" class="form-label">编辑帖子</label>
                <textarea v-model="content" class="form-control" id="edit-area1" rows="3"></textarea>
                <button @click="send_post" class="btn btn-primary btn-sm">发帖</button>
            </div>
        </div>
    </div>
</template>

<script>
import { ref } from "vue";

export default {
    name: "UserProfileWrite",
    setup(props, context) {
        const content = ref('');

        const send_post = () => {
           context.emit("send_post", content.value);
           content.value = '';
        }

        return {
            content,
            send_post,
        }
    }
}
</script>

<style scoped>
.card {
    margin-top: 10px;
}

button {
    margin-top: 10px;
}
</style>